package com.xbongbong.parent.interfaces;

import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.pojo.vo.FormDataAddVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.formdata.pojo.vo.BeforeSaveVO;
import com.xbongbong.pro.formdata.pojo.vo.SaveVO;

/**
 * 工作流使用
 * @author 魏荣杰
 *
 */
public interface FormDataWorkflowService<F, T> {

    /**
     * 新建保存入口
     * @param formDataAddDTO
     * @param beforeSaveVO
     * @return com.xbongbong.pro.formdata.pojo.vo.SaveVO
     * @author 魏荣杰
     * @date 2021/6/17 19:18
     * @throws XbbException
     */
    SaveVO saveForWorkflow(FormDataAddDTO formDataAddDTO, BeforeSaveVO beforeSaveVO, F paasFormEntity, T formData) throws XbbException;

    /**
     * 新建保存之后的逻辑，保存日志、触发业务规则等操作
     * @param formDataAddDTO
     * @param beforeSaveVO 保存之前的方法返回的数据
     * @param saveVO 保存方法返回的数据
     * @return com.xbongbong.pro.formdata.pojo.vo.SaveVO
     * @author 魏荣杰
     * @date 2021/6/17 19:18
     * @throws XbbException
     */
    FormDataAddVO afterSaveForWorkflow(FormDataAddDTO formDataAddDTO, BeforeSaveVO beforeSaveVO, SaveVO saveVO, F paasFormEntity, T formData) throws XbbException;
}
